#define _CRT_SECURE_NO_WARNINGS 1
#include"map.h"
#include"set.h"
void test_map1()
{
	hxs::map<int, int> m;
	int arr[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };

	for (const auto& e : arr)
	{
		m.insert({ e,e });
	}

	m.InOrder();
	cout << endl;
	hxs::map<int, int>::iterator it = m.begin();
	while (it != m.end())
	{
		cout << (*it).first << ' ';
		++it;
	}
}


void test_map2()
{
	hxs::map<int, int> m;
	srand(time(0));
	int N = 10;
	while (N > 0)
	{
		int e = rand();
		m.insert({ e,e });
		N--;
	}

	cout << m.size() << endl;

	hxs::map<int, int>::iterator it = m.begin();
	while (it != m.end())
	{
		cout << (*it).first << ' ';
		++it;
	}

}

void test_map3()
{
	hxs::map<int, int> m;
	int arr[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15, 16, 3, 7, 11, 9 };
	for (const auto& e : arr)
	{
		m[e]++;
	}

	for (const auto& e : m)
	{
		cout << e.first << ':' << e.second << endl;
	}
}

void test_set1()
{
	const hxs::set<int> s;
	int arr[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };

	for (const auto& e : arr)
	{
		/*s.insert(e);*/
	}

	cout << endl;
	hxs::set<int>::iterator it = s.begin();
	while (it != s.end())
	{
		cout << (*it) << ' ';
		++it;
	}
}

int main()
{
	test_set1();
	return 0;
}
